//
//  SelectFactorySectionView.m
//  Rail
//
//  Created by hychen on 2018/3/4.
//  Copyright © 2018年 Hychen. All rights reserved.
//

#import "SelectFactorySectionView.h"

@interface SelectFactorySectionView ()
@property (nonatomic, strong) UIImageView *arrowImage;
@end
@implementation SelectFactorySectionView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
//        BMWeakSelf
//        [self addTapGestureWithBlock:^(UIGestureRecognizer *gestureRecoginzer) {
//            if (weakSelf.BlockClickSection) {
//                weakSelf.BlockClickSection(weakSelf.index);
//            }
//        }];
        
        UILabel *label = [UILabel new];
        label.textColor = Color_Hex(0x2c2c2c);
        label.font = [UIFont systemFontOfSize:17.f];
        self.titleLabel = label;
        [self addSubview:label];
        [label mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(15);
            make.centerY.equalTo(self);
        }];
        
        UIImageView *arrowImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"monitoring_video_up_ic"]];
        [self addSubview:arrowImage];
        self.arrowImage = arrowImage;
        [arrowImage mas_makeConstraints:^(MASConstraintMaker *make) {
            make.width.height.mas_equalTo(12);
            make.right.mas_equalTo(-15);
            make.centerY.equalTo(self);
        }];
    }
    return self;
}

- (void)switchArrowDirection:(BOOL)isDown {
    NSString *imageName = isDown?@"monitoring_video_down_ic":@"monitoring_video_up_ic";
    self.arrowImage.image = [UIImage imageNamed:imageName];
}

@end
